<?php

namespace App\Http\Requests\System;

use App\Http\Requests\BaseRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class Privilege extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            // 'name' => [
            //     'required',
            //     Rule::unique('privileges')
            //     ->ignore(request()->id)
            //     ->whereNull('deleted_at')
            // ],
            'name' => 'required',
            'route' => 'required',
            // 'group_name' => 'required',
            'status' => 'required',
            // 'description' => 'required',
        ];
    }

    public function messages(){
        return [
            'name.required' => '请输入权限名称',
            // 'name.unique' => '权限名称重复',
            'route.required' => '请输入权限路由',
            'group_name.required' => '请输入权限组名称',
            'status.required' => '请输入权限状态',
            'description.required' => '请输入权限描述',
        ];
    }
}
